package figurs;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;

public class LineBot extends Shape {
	static PointList points = new PointList();

	protected void fillShape(Graphics graphics) {
		graphics.fillPolygon(getPoints(getBounds()));
	}

	protected void outlineShape(Graphics graphics) {
		graphics.drawPolygon(getPoints(getBounds()));
	}

	private static PointList getPoints(Rectangle r) {
		points.removeAllPoints();
		Point p = r.getBottomLeft();
		p.setY(p.y-1);
		points.addPoint(p);
		p = r.getBottomRight();
		p.setY(p.y-1);
		points.addPoint(p);
	  return points;
	}
}